From b1592824658cf8a49688ea3eeabd2220b3d13f73 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 17 Feb 2009 05:36:12 +0000 Subject: [PATCH] Set focus when the current page changes. Pointed out by Eitan Isaacson * gtk/gtkassistant.c (set_current_page): Set focus when the current page changes. Pointed out by Eitan Isaacson svn path=/trunk/; revision=22344 --- ChangeLog | 13 +++++++++++++ gtk/gtkassistant.c | 22 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/ChangeLog b/ChangeLog index fff77d86c7..c953f339ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009-02-16 MatthiasClasen + + Bug 572041 – Focus should change when advancing forward in GtkAssistant + + * gtk/gtkassistant.c (set_current_page): Set focus when the current + page changes. Pointed out by Eitan Isaacson + +2009-02-16 MatthiasClasen + + * configure.in: Require GLib 2.19.7 for GMountOperation::aborted. + + * gtk/gtkmountoperation.c: Implement GMountOperation::aborted. + 2009-02-16 Sven Neumann * gdk/gdk.symbols diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c index f2b7315601..45748b6952 100644 --- a/gtk/gtkassistant.c +++ b/gtk/gtkassistant.c @@ -559,6 +559,28 @@ set_current_page (GtkAssistant *assistant, gtk_widget_unmap (old_page->title); } + if (!gtk_widget_child_focus (priv->current_page->page, GTK_DIR_TAB_FORWARD)) + { + GtkWidget *button[6]; + gint i; + + /* find the best button to focus */ + button[0] = assistant->apply; + button[1] = assistant->close; + button[2] = assistant->forward; + button[3] = assistant->back; + button[4] = assistant->cancel; + button[5] = assistant->last; + for (i = 0; i < 6; i++) + { + if (GTK_WIDGET_VISIBLE (button[i]) && GTK_WIDGET_SENSITIVE (button[i])) + { + gtk_widget_grab_focus (button[i]); + break; + } + } + } + gtk_widget_queue_resize (GTK_WIDGET (assistant)); } -- 2.30.2